Write-Host "正在启动二手交易平台项目..." -ForegroundColor Green
Write-Host ""

# 检查是否在正确的目录
if (-not (Test-Path "package.json")) {
    Write-Host "错误：请在项目根目录下运行此脚本" -ForegroundColor Red
    Read-Host "按任意键退出"
    exit 1
}

Write-Host "安装依赖..." -ForegroundColor Yellow
npm install

Write-Host ""
Write-Host "启动开发服务器..." -ForegroundColor Yellow
npm run serve

Write-Host ""
Write-Host "项目启动完成！" -ForegroundColor Green
Write-Host "请在浏览器中访问: http://localhost:8080" -ForegroundColor Cyan
Write-Host ""
Write-Host "功能说明：" -ForegroundColor Magenta
Write-Host "- 支持用户登录和注册" -ForegroundColor White
Write-Host "- 根据用户角色自动跳转到对应页面" -ForegroundColor White
Write-Host "- 管理员跳转到后台管理系统" -ForegroundColor White
Write-Host "- 普通用户跳转到用户中心" -ForegroundColor White
Write-Host ""
Read-Host "按任意键退出" 